﻿using FluentValidation.Results;
using QuartzServices.Domain.Core.Events;

namespace QuartzServices.Domain.Core.Commands
{
    /// <summary>
    /// 抽象命令基类
    /// </summary>
    public abstract class Command : Message
    {

        // 时间戳
        public DateTime Timestamp { get; private set; }

        // 验证结果，这里引用FluentValidation 区别于ViewModel验证
        public ValidationResult ValidationResult { get; set; }

        protected Command()
        {
            Timestamp = DateTime.Now;
        }

        // 定义抽象方法，是否有效
        public abstract bool IsValid();
    }
}
